package com.jspgou.cms.entity.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the jc_sales_statistic table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="jc_sales_statistic"
 */

public abstract class BaseSalesStatistic  implements Serializable {

	public static String REF = "SalesStatistic";
	public static String PROP_NO_ORDER_TOTAL = "noOrderTotal";
	public static String PROP_SALE_TIME = "saleTime";
	public static String PROP_ORDER_TOTAL = "orderTotal";
	public static String PROP_ORDER = "order";
	public static String PROP_ID = "id";


	// constructors
	public BaseSalesStatistic () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseSalesStatistic (java.lang.Long id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseSalesStatistic (
		java.lang.Long id,
		java.util.Date saleTime,
		java.lang.Long orderTotal) {

		this.setId(id);
		this.setSaleTime(saleTime);
		this.setOrderTotal(orderTotal);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Long id;

	// fields
	private java.util.Date saleTime;
	private java.lang.Long orderTotal;
	private java.lang.Long noOrderTotal;

	// many to one
	private com.jspgou.cms.entity.Order order;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="identity"
     *  column="Id"
     */
	public java.lang.Long getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Long id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: sale_time
	 */
	public java.util.Date getSaleTime () {
		return saleTime;
	}

	/**
	 * Set the value related to the column: sale_time
	 * @param saleTime the sale_time value
	 */
	public void setSaleTime (java.util.Date saleTime) {
		this.saleTime = saleTime;
	}


	/**
	 * Return the value associated with the column: order_total
	 */
	public java.lang.Long getOrderTotal () {
		return orderTotal;
	}

	/**
	 * Set the value related to the column: order_total
	 * @param orderTotal the order_total value
	 */
	public void setOrderTotal (java.lang.Long orderTotal) {
		this.orderTotal = orderTotal;
	}


	/**
	 * Return the value associated with the column: no_order_total
	 */
	public java.lang.Long getNoOrderTotal () {
		return noOrderTotal;
	}

	/**
	 * Set the value related to the column: no_order_total
	 * @param noOrderTotal the no_order_total value
	 */
	public void setNoOrderTotal (java.lang.Long noOrderTotal) {
		this.noOrderTotal = noOrderTotal;
	}


	/**
	 * Return the value associated with the column: order_id
	 */
	public com.jspgou.cms.entity.Order getOrder () {
		return order;
	}

	/**
	 * Set the value related to the column: order_id
	 * @param order the order_id value
	 */
	public void setOrder (com.jspgou.cms.entity.Order order) {
		this.order = order;
	}



	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.jspgou.cms.entity.SalesStatistic)) return false;
		else {
			com.jspgou.cms.entity.SalesStatistic salesStatistic = (com.jspgou.cms.entity.SalesStatistic) obj;
			if (null == this.getId() || null == salesStatistic.getId()) return false;
			else return (this.getId().equals(salesStatistic.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}